package org.springcloud.plugin.framework.adapter;

import org.springcloud.plugin.common.constant.DiscoveryConstant;
import org.springframework.beans.factory.annotation.Value;

/**
 * @Author yanggld
 * @Date 2019/12/18-17:53
 * @Description
 */
public class DefaultEnvironmentRouteAdapter implements EnvironmentRouteAdapter {

	@Value("${" + DiscoveryConstant.SPRING_APPLICATION_ENVIRONMENT_ROUTE_ENABLED + ":false}")
	protected Boolean environmentRouteEnabled;

	@Value("${" + DiscoveryConstant.SPRING_APPLICATION_ENVIRONMENT_ROUTE + ":" + DiscoveryConstant.SPRING_APPLICATION_ENVIRONMENT_ROUTE_VALUE + "}")
	protected String environmentRoute;

	@Override
	public boolean isRouteEnabled() {
		return environmentRouteEnabled;
	}

	@Override
	public String getEnvironmentRoute() {
		return environmentRoute;
	}
}
